<?php
namespace Core\CoreCommons;

/**
* Collection class definition.
*
* @method void add($item)
* @method void clear()
* @method void any()
*/
class Collection 
{
	/**
	* @property array This is the internal array
	*/
    private $collection;

	/**
	* The default contstructor
	*/
    public function __construct() 
    {
        $this->collection = array();
    }	
    
	/**
	* The add method
	*
	* @param mixed $item The item to add on the collection
	* @return void
	*/
    public function add($item) 
    {
        array_push($this->collection, $item);
    }
    
	/**
	* The clear method, emptying the internal array
	*
	* @return void
	*/
    public function clear() 
    {
        $this->collection = array();
    }
    
	/**
	* The any method, return true if there is any item, else false
	*
	* @return integer the number of items
	*/
    public function any() 
    {
        return count($this->collection) > 0 ? true : false;
    }
}
?> 